/**
 * 巡检计划
 * **/

import request from '../../utils/request';
import PublicService from '../../services/PublicService'
import StationRuleService  from '../../services/stationRule/stationRuleService'

export default {
  namespace: 'planManage',
  state: {

    selectedRows:[], // 选中行

    // 设置公共变量
    loading: false,
    dataSource:[],
    isVisible:false
  },
  effects: {

    // 删除函数
    *deleteHandle({payload},{put,call,select}){

    },
    *submit({payload},{put,call,select,}){
      yield put({type:'saveInfo',payload:{isVisible:false}})
    },
    * saveInfo({payload}, {put, call, take, select}) {
      let obj = PublicService.deepClone(payload);
      yield put({type: 'save', payload: {...obj}});
    }
  },
  reducers: {
    save(state, {payload}) {
      console.log(payload, 'reduce');
      return {...state, ...payload};
    },
  },
};
